<%--
    Document   : index
    Created on : 12.02.2010, 22:48:51
    Author     : Morfant
--%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="stud.cp.user.valueobjects.Property"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java"%>

<html>
    <%@include file="/header.jsp" %>
    <body>
        <div class="page">
            <%@include file="/cap.jsp" %>
            <div id="main">
                <%@include file="/Designer/designer_cap.jsp" %>
                <h2>Список свойств</h2>
                <table id="buttontable">
                    <tr>
                        <th>
                            <div id="weaponmenucontainer">
                                <ul id="weaponmenu">
                                    <li><a href="<%= response.encodeURL("property-action.do")
                                                            + "?"
                                                            + PluginConst.SUBACTION
                                                            + "="
                                                            + PluginConst.GET_ADD_PAGE%>">Добавить</a></li>
                                </ul>
                            </div>
                        </th>
                    </tr>
                </table>
                <% List<Property> list =
                                    (List<Property>) request.getAttribute(PluginConst.PROPERTIES_LIST);
                            if ((list != null)&&(list.size()>0)) {%>
                <table>
                    <tr>
                        <th>
                        </th>
                        <th>
                            Имя свойства
                        </th>
                        <th>
                            Тип
                        </th>
                        <th>
                            Группа
                        </th>
                    </tr>
                    <%for (Property item : list) {%>
                    <tr>
                        <td>
                            <div id="weaponmenucontainer">
                                <ul id="weaponmenu">
                                    <li><a href="<%= response.encodeURL("property-action.do")
                                                            + "?"
                                                            + PluginConst.SUBACTION
                                                            + "="
                                                            + PluginConst.GET_EDIT_PAGE
                                                            + "&"
                                                            + PluginConst.PROPERTY_ID
                                                            + "="
                                                            + item.getProperty_id()%>">Редактировать</a></li>
                                           <br>
                                           <li><a href="<%= response.encodeURL("property-action.do")
                                                                   + "?"
                                                                   + PluginConst.SUBACTION
                                                                   + "="
                                                                   + PluginConst.GET_DELETE_PAGE
                                                                   + "&"
                                                                   + PluginConst.PROPERTY_ID
                                                                   + "="
                                                                   + item.getProperty_id()%>">Удалить</a></li>
                                </ul>
                            </div>
                        </td>
                        <td>
                            <%= item.getName()%>
                        </td>
                        <td>
                            <%= item.getPropertyTypeName()%>
                        </td>
                        <td>
                            <%= item.getPropertyGroupName()%>
                        </td>
                    </tr>
                    <% }%>
                </table>
                <% }%>
            </div>
        </div>
    </body>
</html>
